From 265907317ce7cb96b3e3eca32944e6c3429bb5b2 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Sat, 24 Apr 2004 23:42:26 +0000 Subject: [PATCH] (x_draw_hollow_cursor): Fix height of box for narrow lines. --- src/macterm.c | 3 ++- src/xterm.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/macterm.c b/src/macterm.c index dd5f2504032..fdb61249629 100644 --- a/src/macterm.c +++ b/src/macterm.c @@ -4665,7 +4665,8 @@ x_draw_hollow_cursor (w, row) /* Compute the proper height and ascent of the rectangle, based on the actual glyph. Using the full height of the row looks bad when there are tall images on that row. */ - h = max (FRAME_LINE_HEIGHT (f), cursor_glyph->ascent + cursor_glyph->descent); + h = max (min (FRAME_LINE_HEIGHT (f), row->height), + cursor_glyph->ascent + cursor_glyph->descent); if (h < row->height) y += row->ascent /* - w->phys_cursor_ascent */ + cursor_glyph->descent - h; h--; diff --git a/src/xterm.c b/src/xterm.c index bed9842fdc8..60ec7ec8830 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -7258,7 +7258,8 @@ x_draw_hollow_cursor (w, row) /* Compute the proper height and ascent of the rectangle, based on the actual glyph. Using the full height of the row looks bad when there are tall images on that row. */ - h = max (FRAME_LINE_HEIGHT (f), cursor_glyph->ascent + cursor_glyph->descent); + h = max (min (FRAME_LINE_HEIGHT (f), row->height), + cursor_glyph->ascent + cursor_glyph->descent); if (h < row->height) y += row->ascent /* - w->phys_cursor_ascent */ + cursor_glyph->descent - h; h--; -- 2.30.2